home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / database / msgobj10.zip / PIPBASE.H < prev    next >
C/C++ Source or Header  |  1993-03-25  |  19KB  |  402 lines

  1. /* PipBase.H: this file contains all data structure definition and 
  2. notes on how to manage them. All PipBase-compatible programs have to 
  3. refer to these informations */
  4.  
  5. /* data alignment is on bytes */
  6. /* int (and uint) are 16 bits integers, LSB first */
  7.  
  8. #pragma pack(1)
  9.  
  10. /* something about file names and location:
  11.  
  12. In your main directory there is the file NODEINFO.CFG, that holds all
  13. general informations: it's an unique record of type NODEINFO.
  14.  
  15. In another directory (well, it may be the same of NodeInfo.Cfg), the
  16. so-called pipbase directory, there are:
  17.  
  18. ORIGINS.PIP:  a file containing 256 char[60] null-terminated strings: your
  19.               origins. (*)
  20.  
  21. BASEDESC.PIP: a file of records of the type AREASTRUCT, containing the area
  22.               definitions. (*)
  23.  
  24. DESTPTR.PIP:  a file of DESTPTR type records. (*)
  25.  
  26. LASTREAD.PIP: a file of 8 or more tables of <cfg.model> integers each.
  27.               First 8 records are for the sysops indicated in NODEINFO.CFG;
  28.               following entries can be used for BBS users. (*)
  29.  
  30. MPTRxxxx.PIP, where xxxx is an hexadecimal number: a file of records of type
  31.               MSGPTR, indexing area xxxx. (*)
  32.  
  33. MPKTxxxx.PIP, where xxxx is an hexadecimal number: a file of packed
  34.               messages, each formed by a MSGPKTHDR record and five
  35.               null-terminated strings; the file is terminated by a double
  36.               null (that, with the terminator of the last string, forms a
  37.               three-zeroes sequence); it contains area xxxx texts;
  38.               the five null'terminated strings are the to, from, subj,
  39.               date and text fields of the standard FTS-0001 packets. (*)
  40.  
  41. FRIENDND.PIP: a file of FRIENDND type records, each of whom has an entry in
  42.               the forward_to bitmap of BASEDESC.PIP.
  43.               Notice that not all forward_to entries has to be assigned to a
  44.               record: a point does not need a large FRIENDND!
  45.  
  46. ROUTE.PIP:    a file of ROUTE records, containing informations on how to
  47.               route netmail 
  48.  
  49. Only files marked with an (*) are the pipbase standard. Other files are used
  50. by PipBase.Exe and PipSetup, but you may change them (and, if possible, inform
  51. the authors of these changes).
  52.  
  53. */
  54.  
  55.  
  56. typedef unsigned int uint;
  57.  
  58.  
  59. typedef struct /* structure of the message headers in MPKTxxxx.PIP files */
  60.                { uint pktype; /* 2= not compressed; 10=compressed with PIP */
  61.                  uint fromnode,tonode,fromnet,tonet; /* for netmail */
  62.                  uint attribute; /* bit 0=private as for SeaDog,
  63.                                         1=crash as for SeaDog,
  64.                                         2=received as for SeaDog,
  65.                                         3=sent as for SeaDog,
  66.                                         4=fileattach as for SeaDog,
  67.                                         5=in transit as for SeaDog,
  68.                                         7=kill/sent as for SeaDog,
  69.                                         8=local as for SeaDog,
  70.                                         9=hold as for SeaDog,
  71.                                         10=locked,
  72.                                         11=filerequest as for SeaDog,
  73.                                         12=Return Receipt request,
  74.                                         13=Is Return Receipt,
  75.                                         14=Audit Request,
  76.                                         15=fileupdaterequest as for SeaDog */
  77.                                 /* when echomail, bit 3=1 means "processed"; */
  78.                  uint point; /* FMPT for inbound messages, TOPT for outbound messages */
  79.                } MSGPKTHDR;
  80.  
  81. #define SET_PKT_PRIV 1
  82. #define SET_PKT_CRASH 2
  83. #define SET_PKT_RCVD 4
  84. #define SET_PKT_SENT 8
  85. #define SET_PKT_ATTACH 16
  86. #define SET_PKT_TRANSIT 32
  87. #define SET_PKT_KILL 128
  88. #define SET_PKT_LOCAL 256
  89. #define SET_PKT_HOLD 512
  90. #define SET_PKT_LOCK 1024
  91. #define SET_PKT_REQUEST 2048
  92. #define SET_PKT_RRRQ 4096
  93. #define SET_PKT_ISRR 8192
  94. #define SET_PKT_AUDIT 16384
  95. #define SET_PKT_UPDATE 32768
  96. #define RESET_PKT_PRIV 0xfffe
  97. #define RESET_PKT_CRASH 0xfffd
  98. #define RESET_PKT_RCVD 0xfffb
  99. #define RESET_PKT_SENT 0xfff7
  100. #define RESET_PKT_ATTACH 0xffef
  101. #define RESET_PKT_TRANSIT 0xffdf
  102. #define RESET_PKT_KILL 0xff7f
  103. #define RESET_PKT_LOCAL 0xfeff
  104. #define RESET_PKT_HOLD 0xfdff
  105. #define RESET_PKT_LOCK 0xfbff
  106. #define RESET_PKT_REQUEST 0xf7ff
  107. #define RESET_PKT_RRRQ 0xefff
  108. #define RESET_PKT_ISRR 0xdff
  109. #define RESET_PKT_AUDIT 0xbfff
  110. #define RESET_PKT_UPDATE 0x7fff
  111.  
  112. #define SEADOG_MASK 0x7413
  113.  
  114.  
  115. typedef struct /* structure of each record in MPTRxxxx.PIP files */
  116.                { long pos;       /* pointer to MPKTxxxx.PIP */
  117.                  uint prev,next;  /* pointers to other records in MPTRxxxx */
  118.                  uint status;     /* bit 0=deleted 1=received 2=sent */
  119.                                   /* 3=fromus(1)/tous(0) 4=Locked (Undeletable) */
  120.                } MSGPTR;
  121.  
  122. #define SET_MPTR_DEL 1
  123. #define SET_MPTR_RCVD 2
  124. #define SET_MPTR_SENT 4
  125. #define SET_MPTR_FROMUS 8
  126. #define SET_MPTR_LOCK 16
  127. #define RESET_MPTR_DEL 0xfffe
  128. #define RESET_MPTR_RECV 0xfffd
  129. #define RESET_MPTR_SENT 0xfffb
  130. #define RESET_MPTR_FROMUS 0xfff7
  131. #define RESET_MPTR_LOCK 0xfffef
  132.  
  133.  
  134. typedef struct /* structure of each record in DESTPTR.PIP */
  135.                { char to[36]; /* addressee name */
  136.                  uint area,msg; /* pointers to MPTRarea.PIP records */
  137.                  long next; /* to speed up search (in future: NOT YET IMPLEMENTED) */
  138.                } DESTPTR;
  139.  
  140.  
  141. typedef struct /* structure of addresses in NODEINFO.CFG */
  142.                { uint zone,net,node,point;
  143.                  char domain[20];
  144.                } NODEADDR;
  145.  
  146.  
  147. typedef struct /* structure of the unique record NODEINFO.CFG */
  148.                { NODEADDR address[10]; /* network addresses */
  149.                  uint fakenet; /* pointnet address, DON'T USE IT IF POSSIBLE */
  150.                  char logfilename[64], /* Location of log file, NUL for none */
  151.                       loglevel, /* 0...3, from less to more detailed */
  152.                       logtype; /* 0: Opus/Binkley; 1: Frodo/D'Bridge */
  153.                  char pipdir[64]; /* where PIPbase files are located, slash terminated */
  154.                  uint pipsize; /* how many messages areas have you? */
  155.                                /* 256=SMALL, 1024=MEDIUM, 4096=LARGE, 32768=EXTRA-LARGE */
  156.                  char usernames[8][35]; /* names of sysops accessing the system */
  157.                  char inbound[64],outbound[64]; /* inbound and outbound directories */
  158.                  char packerdir[64],tempdir[64];
  159.                  char compact; /* bit 0: remove unuseful kludges 
  160.                                   bit 1: remove Re:
  161.                                   bit 2: remove 4D-informations
  162.                                   bit 3: kill robot received messages
  163.                                   bit 4: kill sent robot messages 
  164.                                   bit 5: don't put ^aREPLY 
  165.                                   bit 6: don't put domain in MSGIDs */
  166.                  char packer[13],packerparms[40]; /* default packer */
  167.                  char attaches[64]; /* where Netmail fileattaches are stored */
  168.                  char attachstyle; /* 0=Pip!, 1=Frodo/D'B, 2=Bink/TrapDoor */
  169.                  char pack_matrix; /* 0=dynamic packing; 1=matrix is packed but not compressed; 2= matrix is packed and compressed */
  170.                                    /* with Binkley and Pip! mode 0 is illegal */
  171.                  char addtear[20]; /* add this string to the regular tearline */
  172.                  char receipt[64]; /* file for return receipt */
  173.                  char ghost[35];   /* name for Ghost Writer */
  174.                  char use_uucp;    /* use UUCP gateway to access internet */
  175.                  uint uucp_out_zone, /* bit 0: gateway enabled */
  176.                       uucp_out_net,  /* bit 1: use ghostwriter also in UUCP */
  177.                       uucp_out_node,
  178.                       uucp_in_zone,
  179.                       uucp_in_net,
  180.                       uucp_in_node;
  181.                  char create_new_areas; /* create new areas if this is 1 */
  182.                  char compat_box[13]; /* to be compatible with precedent versions */
  183.                  char fast_export; /* to flag as sent just imported messages */
  184.                  char route_crash_via_boss; /* to route crashmail addressed to points */
  185.                  char key[22];     /* THE REGISTRATION KEY; leave 0 if not used */
  186.                  char jolly[13],jollyparms[40]; /* The jolly unpacker */
  187.                } NODEINFO;
  188.  
  189. #define SET_COMPACT_REMOVE_KLUDGES 1
  190. #define RESET_COMPACT_REMOVE_KLUDGES 0xfffe
  191. #define SET_COMPACT_REMOVE_REPLY 2
  192. #define RESET_COMPACT_REMOVE_REPLY 0xfffd
  193. #define SET_COMPACT_REMOVE_4D 4
  194. #define RESET_COMPACT_REMOVE_4D 0xfffb
  195. #define SET_COMPACT_KILLROBOTRQ 8
  196. #define RESET_COMPACT_KILLROBOTRQ 0xfff7
  197. #define SET_COMPACT_KILLROBOTASW 16
  198. #define RESET_COMPACT_KILLROBOTASW 0xffef
  199. #define SET_COMPACT_NOREPLY 32
  200. #define RESET_COMPACT_NOREPLY 0xffdf
  201. #define SET_COMPACT_NODOMAIN_MSGID 64
  202. #define RESET_COMPACT_NODOMAIN_MSGID 0xffbf
  203.  
  204. #define SET_UUCP 1
  205. #define SET_UUCP_GHOST 2
  206.  
  207.  
  208. typedef struct /* structure for each record of BASEDESC.PIP */
  209.                { char descr[40], /* description of the area */
  210.                       tag[30]; /* echomail tag, #LOCAL, #BAD,#DUPES or #NETMAIL */
  211.                  uint nrmsgs,days; /* to perform PURGE; nrmsgs=0: passthru area */
  212.                  unsigned char killrcv, /* kill received messages? */
  213.                       readlevel,readflags[4],writelevel,writeflags[4], /* for Remote Access style access control */
  214.                       origin, address, /* index for the appropriate table */
  215.                       note[80], /* whatever you want */
  216.                       forward_to[32]; /* this is a bitmap on FRIENDND.PIP's 256 records */
  217.                  char origmode; /* 0=fixed origin; 1=random system; 2=cyclic system */
  218.                  int startorig,endorig; /* for random or cyclic origin selection */
  219.                  long inmsgmonth,inmsgyear; /* for statistics */
  220.                  long outmsgmonth,outmsgyear; /* for statistics */
  221.                  char expansion_box[36]; /* please apply to define this */
  222.                } AREASTRUCT;
  223.  
  224.  
  225. typedef struct /* structure for each record in FRIENDND.PIP */
  226.                { uint zone,net,node,point; /* address */
  227.                  char packer[13], /* the .exe or .com file to run packer */
  228.                       packerparms[40], /* parameters to be passed */
  229.                       packet_pw[8]; /* packet password */
  230.                  long inmsgmonth,inmsgyear; /* for statistics */
  231.                  long outmsgmonth,outmsgyear; /* for statistics */
  232.                  char unused; /* reserved for future use */
  233.                  char areafix_pw[25]; /* Areafix Password */
  234.                  uint areafix_lev;
  235.                  uint flags; /* bit 0=uses PipMail; 
  236.                                 bit 1=active(1)/inactive(0);
  237.                                 bit 2=deleted;
  238.                                 bit 3=hold 
  239.                                 bit 4=crash */
  240.                  char notes[80]; /* whatever you want */
  241.                } FRIENDND;
  242.  
  243. #define FRI_SET_PIPMAIL 1
  244. #define FRI_RESET_PIPMAIL 0xfffe
  245. #define FRI_SET_ACTIVE 2
  246. #define FRI_RESET_ACTIVE 0xfffd
  247. #define FRI_SET_DEL 4
  248. #define FRI_RESET_DEL 0xfffb
  249. #define FRI_SET_HOLD 8
  250. #define FRI_RESET_HOLD 0xfff7
  251. #define FRI_SET_CRASH 16
  252. #define FRI_RESET_CRASH 0xffef
  253.  
  254.  
  255. typedef struct {
  256.                  unsigned int
  257.                       orig_node,               /* originating node */
  258.                       dest_node,               /* destination node */
  259.                       year,                    /* 1990 - nnnn */
  260.                       month,                   /* month -1 */
  261.                       day,                     
  262.                       hour,
  263.                       minute,
  264.                       second,
  265.                       rate,                    /* unused */
  266.                       ver,                     /* 2 */
  267.                       orig_net,                /* originating net */
  268.                       dest_net;                /* destination net */
  269.                  unsigned char
  270.                       product,                 /* product code */
  271.                       rev_lev,                 /* revision level */
  272.                       password[8];
  273.                  unsigned int
  274.                       qm_orig_zone,            /* QMail orig.zone */
  275.                       qm_dest_zone,            /* QMail dest.zone */
  276.                       wm_orig_point,           /* Wmail orig.point */
  277.                       wm_dest_point;           /* Wmail dest.point */
  278.                  unsigned char
  279.                       TRASH[4];                /* junk[4] */
  280.                  unsigned int
  281.                       orig_zone,               /* originating zone */
  282.                       dest_zone,               /* destination zone */
  283.                       orig_point,              /* originating point */
  284.                       dest_point;              /* destination point */
  285.                  unsigned long
  286.                       pr_data;
  287.                  } MAILPKT;
  288.  
  289.  
  290. typedef struct {
  291.                  unsigned char fromwho[36],towho[36],subj[72],date[20];
  292.                  uint times,
  293.                       destnode,orignode,
  294.                       cost,
  295.                       orignet,destnet,
  296.                       destzone,origzone,
  297.                       destpoint,origpoint,
  298.                       reply,attr,nextreply;
  299.                } FIDOMSG;
  300.  
  301.  
  302. typedef struct /* structure of each record in ROUTE.PIP */
  303.                {
  304.                  unsigned char mode; /* see table below */
  305.                  unsigned char via; /* pointer to a friend node */
  306.                  uint zone,net,node,point;
  307.                } ROUTE;
  308. /* mode can be one of following values:
  309. 0: route all exported matrix via the specified friend
  310.    (zone,net,node and point fields are ignored)
  311. 1: route all the specified zone via the friend
  312.    (net,node and point fields are ignored)
  313. 2: route all the specified region via the friend
  314.    (last digit of net number, node and point fields are ignored)
  315. 3: route all the specified net via the friend
  316.    (node and point fields are ignored)
  317. 4: route all the hub via the friend
  318.    (last two digits of the node field and the point field are ignored)
  319. 5: route the node and all his points via the friend
  320.    (point field is ignored)
  321. 6: route that point via that friend
  322.  
  323. If not specified:
  324. - a point routes all his mail via his boss
  325. - a boss routes all his mail via his hub (we maded the asumption that
  326.   the hub of BBS xxx/yyzz has always node number xxx/yy00) or directly
  327.   to his points.
  328. - a hub (or a node without a hub) routes all his mail via the network
  329.   coordinator, or sends it directly to his subnodes
  330. - a host routes all his mail via the other network coordinators, or
  331.   via the hubs if they're defined, or via a zonegate, or to his
  332.   subnodes
  333. - all mail for points is always routed via their boss
  334. - all mail for defined friends is sent directly
  335. */
  336.  
  337. #define ROUTE_ALL 0
  338. #define ROUTE_ZONE 1
  339. #define ROUTE_REGION 2
  340. #define ROUTE_NET 3
  341. #define ROUTE_HUB 4
  342. #define ROUTE_NODE 5
  343. #define ROUTE_POINT 6
  344.  
  345.  
  346. typedef struct { /* an unique record in SYSTEM.CFG */
  347.                  unsigned char port, /* modem port, following fossil, 0-based, 
  348.                                         numbering; 255=no modem (useful for 
  349.                                         testing, demonstration, LAN, floppynet,
  350.                                         and if you're using Pip! only for 
  351.                                         making coffee, with the proper 
  352.                                         hardware) */
  353.                                speed; /* bit 7=lockbaud; bit 6=MX5 is used;
  354.                                          bit 5=null-modem link;
  355.                                          others=speed, following fossil coding */
  356.                  char okstring[20], /* default= OK; in all strings, | means cr and ~ means wait */
  357.                       nocarrier[20], /* default=NO CARRIER */
  358.                       busy[20], /* default is BUSY used only with ATX4 responses */
  359.                       voice[20], /* default=VOICE used only with ATX4 responses */
  360.                       init[3][40], /* including AT, but not the final CR; default is "ATS0=1Q0V1X1","",""*/
  361.                       deinit[40], /* default=ATS0=0 */
  362.                       answer[40], /* default=ATA */
  363.                       ringing[20], /* default=RING; R.I. signal on line is not monitored */
  364.                       reliable[3][20], /* when line is reliable; defaults are "MNP","REL" and "HST" */
  365.                       halfduplex[3][20], /* when bidirectional protocols are not avaible; defaults are "HST","1275" and "7512" */
  366.                       connect[10][20], /* defaults are CONNECT\r, CONNECT 1200, CONNECT 2400, CONNECT 9600, CONNECT 14400, CONNECT 19200, CONNECT 38K, CONNECT 1275, CONNECT 7512 */
  367.                       error[20], /* default is ERROR */
  368.                       busy_in[40], /* default is ATH1 */
  369.                       busy_out[40], /* ATH0 */
  370.                       whenbusy, /* bit 0=busy when shelling (deafult 0), 1=DTR off when shelling(1); 2=busy when exiting(0), 3=DTR off when exiting(1)*/
  371.                       answer_timeout, /* in seconds; default=40 */
  372.                       busy_retries, voice_retries, nocarrier_retries, /* number of retries alloweed; default=2 for voice, 10 for nocarrier and 20 for busy */
  373.                       retry_timeout, /* default=12 tens of seconds */                      
  374.                       dial_prefix[20], /* usually ATD */
  375.                       dial_suffix[20], /* usually "" */
  376.                       pre_dial[20], /* usually "" */
  377.                       terminit[40], /* usually ATS0=0E1 */
  378.                       modem_expansion[300],
  379.                       scrlines, /* lines on screen; usually 25, it may be 25 (CGA/Hercules), 43 (EGA) or 50 (VGA) */ 
  380.                       monitor, /* bit 0=no snow; bit 1=monochrome monitor */
  381.                       screen_expansion[100],
  382.                       system_name[40], /* site info: BBS Name */
  383.                       location[40], /* location */
  384.                       telephone[40], /* telephone number */
  385.                       site_exp[500],
  386.                       banner[80], /* this is sent, follwed by a \r\n, when the
  387.                                      modem answers the call; You may place a #
  388.                                      followed by a complete filename to have
  389.                                      that text file sent */
  390.                       human[80], /* This is displayed when passing to BBS (you
  391.                                     may use the # also here */
  392.                       mailonly[80]; /* sent to the user when in mail only event */
  393.                } MAILERCFG;  
  394.  
  395. typedef struct {uint net,node,point;} AUDIT;
  396.  
  397. #ifndef BUFSIZE
  398.   #define BUFSIZE 30000
  399. #endif
  400.  
  401. #define NODEADDRDEF
  402.